<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="entity.Course" %>

<jsp:useBean id="user" class="entity.User" scope="session"></jsp:useBean>

<html>
  <head>
    <base href="<%=basePath%>">
    <title>全部课程</title>
  </head>
  <body>
   <table>
  		<jsp:include page="/jsp/top.jsp"/>
  	    <tr valign="top">
  	    <td width="20%">
  	     <jsp:include page="/jsp/leftAdmin.jsp"/>
  	    </td>
  	    <td align="center">
		<table border="1">
		  <tr>
		    <th>课程号</th>
		    <th>课程名</th>
		    <th>开设学期</th>
		    <th>学分</th>
		    <th></th>
		  </tr>
		  <%
		  	Object o = request.getSession().getAttribute("list");
		  	if(o!=null){
		  		List<Course> list = (List<Course>)o;
		  		for(int i=0;i<list.size();i++){
		   %>
		  <tr>
		    <td><%= list.get(i).getCourseNumber() %></td>
		    <td><%= list.get(i).getCourseName() %></td>
		    <td><%= list.get(i).getCourseSemester() %></td>
		    <td><%= list.get(i).getCourseScore() %></td>
		    <td><a href="<%=pageContext.getServletContext().
		    getContextPath()%>/RemoveCourseServlet?cid=<%=list.get(i).getCourseNumber()%>&cName=<%=list.get(i).getCourseName()%>&cSemester=<%=list.get(i).getCourseSemester()%>&cScore=<%=list.get(i).getCourseScore()%>">删除</a></td>
		  </tr>
		   <%
		  		}
		  	}
		   %>
		</table>
		</td>
		</tr>
		</table>
  </body>
</html>
